﻿using SuperMoney.Datas.DbModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Transactions;

namespace SuperMoney.Datas
{
	/// <summary>
	/// 积分交易数据服务。
	/// </summary>
    public class IntegralTradeDbService
    {
		/// <summary>
		/// 积分交易数据服务实例。
		/// </summary>
		public static readonly IntegralTradeDbService Instance = new IntegralTradeDbService();

		/// <summary>
		/// 创建积分交易
		/// </summary>
		/// <param name="integralTrade"></param>
		public void Create(IntegralTrade integralTrade)
		{
			integralTrade.AddTime = DateTime.Now;
			integralTrade.UpdateTime = DateTime.Now;

			using (var db = MRMDB.New())
			{
				db.IntegralTradeSet.Add(integralTrade);
				db.SaveChanges();
			}
		}
    }
}
